package com.witmore.ftp.web;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

/**
 * Witmore FTP 服务启动类
 */
@SpringBootApplication
@ComponentScan(basePackages = {"com.witmore.ftp"})
@MapperScan(basePackages = "com.witmore.ftp.db.mapper", 
           lazyInitialization = "${mybatis.lazy-initialization:false}")
public class WitmoreFtpApplication {

    public static void main(String[] args) {
        // 设置系统属性解决Spring Boot 3.x与MyBatis-Plus兼容性问题
        System.setProperty("spring.main.lazy-initialization", "true");
        System.setProperty("spring.jpa.open-in-view", "false");
        
        SpringApplication app = new SpringApplication(WitmoreFtpApplication.class);
        app.setLazyInitialization(true);
        app.run(args);
    }
}
